﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Practices.Prism.MefExtensions.Modularity;
using Microsoft.Practices.Prism.Modularity;
using System.ComponentModel.Composition;
using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.ServiceLocation;

namespace EIA.SLClient.ProjectManage
{
    [ModuleExport(typeof(BaseModule))]
    public class BaseModule : IModule
    {
        [Import]
        public IRegionManager RegionManager;

        public void Initialize()
        {
            ServiceLocator.Current.GetInstance<LoadingView>();
            RegionManager.RegisterViewWithRegion(EIA.SLClient.ProjectManage.Infrastructure.RegionNames.OverlayRegion, typeof(LoadingView));
            EIA.WCFService.AuthProxy.X.ServiceAddress = "http://localhost:8732/Design_Time_Addresses/EIA.WCFService.AuthenticationService/basic";
            EIA.Basic.BLL.ClientProxy.X.ServiceAddress = "http://localhost:8733/Design_Time_Addresses/EIA.WCFService.BasicLogicalService/basic";
            EIA.PM.BLL.ClientProxy.X.ServiceAddress = "http://localhost:8734/Design_Time_Addresses/EIA.WCFService.ProjectManageLogicalService/basic";

            try
            {
                RegionManager.RegisterViewWithRegion(EIA.SLClient.ProjectManage.Infrastructure.RegionNames.HeaderRegion, typeof(LoginStateView));
                RegionManager.RegisterViewWithRegion(EIA.SLClient.ProjectManage.Infrastructure.RegionNames.PopupRegion,typeof(LoginView));
            }
            catch (System.Exception ex)
            {
            	
            }
        }
    }
}
